home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / bsrc_p2.arc / OPUS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1988-11-30  |  45.0 KB  |  891 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*               The Opus Computer-Based Conversation System                */
  3. /*       (c) Copyright 1986, Wynn Wagner III, All Rights Reserved           */
  4. /*                                                                          */
  5. /*                                                                          */
  6. /*                   YOOHOO is a trademark of Wynn Wagner III               */
  7. /*                                                                          */
  8. /*                        YOOHOO-YOOHOO/2U2 & WaZOO are                     */
  9. /*           Copyright 1987, Wynn Wagner III, All Rights Reserved           */
  10. /*                                                                          */
  11. /*                                                                          */
  12. /*                                                                          */
  13. /* This material is available for use by anybody with no strings and        */
  14. /* no guarantees.                                                           */
  15. /*                                                                          */
  16. /*--------------------------------------------------------------------------*/
  17.  
  18.  
  19.  
  20. /*--------------------------------------------------------------------------*/
  21. /* LEGIBLE SECTION.  Definitions to make "C" look like a real language.     */
  22. /*--------------------------------------------------------------------------*/
  23. #define begin        {
  24. #define end          }
  25.  
  26. #define true         (-1)
  27. #define false        0
  28. #define Procedure    void
  29.  
  30. #define shl          <<
  31. #define shr          >>
  32. #define xor          ^
  33. #define and          &&
  34. #define or           ||
  35. #define not          !
  36. #define mod          %
  37.  
  38. #ifndef max
  39. #define max(a,b)     ((a)>(b)?(a):(b))
  40. #endif
  41.  
  42. #ifndef min
  43. #define min(a,b)     ((a)<=(b)?(a):(b))
  44. #endif
  45.  
  46. typedef unsigned      bit;
  47. typedef unsigned int  word;
  48. typedef unsigned char byte;
  49.  
  50. #define fallthrough        /* ... for use in switch statements for clarity. */
  51.  
  52.  
  53.  
  54. /*--------------------------------------------------------------------------*/
  55. /* Bit flags for EchoScan                                                   */
  56. /*--------------------------------------------------------------------------*/
  57. #define NUM_BITS 100
  58. extern char bits[ 1+(NUM_BITS/8) ];
  59.  
  60.  
  61.  
  62. /*--------------------------------------------------------------------------*/
  63. /* TIME STAMP                                                               */
  64. /*--------------------------------------------------------------------------*/
  65. struct _stamp
  66.    begin
  67.        unsigned int   date;
  68.       unsigned int   time;
  69.    end;
  70.  
  71.  
  72.  
  73.  
  74. /*--------------------------------------------------------------------------*/
  75. /* NodeList.Sys                                                             */
  76. /*                                                                          */
  77. /*    NET > 0 and NODE > 0    Normal node                                   */
  78. /*                                                                          */
  79. /*    NET > 0 and NODE <= 0   Host node                                     */
  80. /*                               Net host........node== 0                   */
  81. /*                               Regional host...node==-1                   */
  82. /*                               Country host....node==-2                   */
  83. /*                                                                          */
  84. /*    NET == -1      Nodelist.Sys revision                                  */
  85. /*                                                                          */
  86. /*    NET == -2      Nodelist statement                                     */
  87. /*                                                                          */
  88. /*--------------------------------------------------------------------------*/
  89.  
  90.  
  91. /*--------------------------------------------------------------------------*/
  92. /* NODE                                                                     */
  93. /* Please note the NewStyle structure (below).  Time is running out for the */
  94. /* existing `_node' structure!  Opus currently uses the old style node      */
  95. /* structure, but not for long.                                             */
  96. /*--------------------------------------------------------------------------*/
  97. struct _node
  98.    begin
  99.       int   number;        /* node number                                   */
  100.       int   net;           /* net number                                    */
  101.       int   cost;          /* cost of a message to this node                */
  102.       int   rate;          /* baud rate                                     */
  103.       char  name[20];      /* node name                                     */
  104.       char  phone[40];     /* phone number                                  */
  105.       char  city[40];      /* city and state                                */
  106.    end;
  107.  
  108.  
  109. /*--------------------------------------------------------------------------*/
  110. /* THE NEWSTYLE NODE LIST IS *NOT* USED RIGHT NOW                           */
  111. /*--------------------------------------------------------------------------*/
  112. #ifdef NEWSTYLE
  113.   struct _node
  114.      begin
  115.         word NetNumber;
  116.         word NodeNumber;
  117.         word Cost;             /* cost to user for a message */      
  118.         byte SystemName[34];   /* node name */
  119.         byte PhoneNumber[40];  /* phone number */
  120.         byte MiscInfo[30];     /* city and state */
  121.         byte Password[8];      /* WARNING: not necessarily null-terminated */
  122.         word RealCost;         /* phone company's charge */
  123.         word HubNode;          /* node # of this node's hub or 0 if none */
  124.         byte BaudRate;         /* baud rate divided by 300 */
  125.         byte ModemType;        /* RESERVED for modem type */
  126.         word NodeFlags;        /* set of flags (see below) */
  127.         word NodeFiller;
  128.      end;
  129.  
  130.  
  131. #define B_hub    0x0001  /* node is a net hub     0000 0000 0000 0001 */
  132. #define B_host   0x0002  /* node is a net host    0000 0000 0000 0010 */
  133. #define B_region 0x0004  /* node is region coord  0000 0000 0000 0100 */
  134. #define B_CM     0x0008  /* runs continuous mail  0000 0000 0000 1000 */
  135. #define B_res1   0x0010  /* reserved by Opus      0000 0000 0001 0000 */
  136. #define B_res2   0x0020  /* reserved by Opus      0000 0000 0010 0000 */
  137. #define B_res3   0x0040  /* reserved by Opus      0000 0000 0100 0000 */
  138. #define B_res4   0x0080  /* reserved by Opus      0000 0000 1000 0000 */
  139. #define B_res5   0x0100  /* reserved by Opus      0000 0001 0000 0000 */
  140. #define B_res6   0x0200  /* reserved for non-Opus 0000 0010 0000 0000 */
  141. #define B_res7   0x0400  /* reserved for non-Opus 0000 0100 0000 0000 */
  142. #define B_res8   0x0800  /* reserved for non-Opus 0000 1000 0000 0000 */
  143. #define B_res9   0x1000  /* reserved for non-Opus 0001 0000 0000 0000 */
  144. #define B_resa   0x2000  /* reserved for non-Opus 0010 0000 0000 0000 */
  145. #define B_resb   0x4000  /* reserved for non-Opus 0100 0000 0000 0000 */
  146. #define B_resc   0x8000  /* reserved for non-Opus 1000 0000 0000 0000 */
  147. #endif
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154. /*--------------------------------------------------------------------------*/
  155. /* Nodelist.Idx                                                             */
  156. /* (File is terminated by EOF)                                              */
  157. /*--------------------------------------------------------------------------*/
  158. struct _ndi
  159.    begin
  160.       int   node;          /* node number  */
  161.       int   net;           /* net number   */
  162.    end;
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169. #define MAXEXPAND 30          /* max download files (wildcard expansion)    */
  170. #define CMDLEN    60          /* size of the command typeahead buffer       */
  171. #define CARRYLEN  20          /* LORE editor's carry buffer                 */
  172. #define MAXLEN    85          /* size of primary line-input buffer          */
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179. /*--------------------------------------------------------------------------*/
  180. /* OPUS CONTROL FILE AND PARM FILE DECLARATIONS                             */
  181. /*--------------------------------------------------------------------------*/
  182.  
  183. #define  THIS_CTL_VERSION  15       /* ASSEMBLER VERSION NUMBER             */
  184.  
  185.  
  186. #ifdef   COMPILER
  187. #           define CTLSIZE 0x7fff   /* Only used when compiling OPUS_CTL    */
  188. #           define OFS     int
  189. #else
  190. #           define CTLSIZE 1
  191. #           define OFS     char*
  192. #endif
  193.  
  194.  
  195. #define  MAX_EXTERN         8       /* max. number of external programs     */
  196. #define  MAXCLASS          12       /* number of possible priv levels       */
  197. #define  ALIAS_CNT         15       /* number of matrix addresses           */
  198.  
  199.  
  200.                /*-----------------------------------------------------------*/
  201.                /* Information about a class of users.  Warning: This is NOT */
  202.                /* a stable structure.                                       */
  203.                /*-----------------------------------------------------------*/
  204. struct   class_rec
  205.             {
  206.                int          priv;
  207.                int          max_time;      /* max cume time per day         */
  208.                int          max_call;      /* max time for one call         */
  209.                int          max_dl;        /* max dl bytes per day          */
  210.                unsigned int ratio;         /* ul:dl ratio                   */
  211.                unsigned int min_baud;      /* speed needed for logon        */
  212.                unsigned int min_file_baud; /* speed needed for file xfer    */
  213.             };
  214.  
  215.  
  216.  
  217.  
  218.                /*-----------------------------------------------------------*/
  219.                /* The structure of a PRM file created                       */
  220.                /*                                                           */
  221.                /* This is *NOT* a stable structure, check the assembler's   */
  222.                /* version number.  If the version (above) doesn't match the */
  223.                /* number in the file you are reading, you are GUARANTEED    */
  224.                /* that the structure has changed because that's what the    */
  225.                /* version means.  The location of the version number at     */
  226.                /* offset zero is assured for all future versions.           */
  227.                /*                                                           */
  228.                /*-----------------------------------------------------------*/
  229. struct pointers {
  230.  
  231.                /*-----------------------------------------------------------*/
  232.                /* DATA                                                      */
  233.                /*-----------------------------------------------------------*/
  234.          byte  version;        /* for safety                                */
  235.          byte  testmode;       /* input from keyboard, not modem            */
  236.          long  total_callers;  /* total number of callers to system         */
  237.          long  quote_position; /* last position used in last quote file     */
  238.          byte  multitasker;    /* flag for DoubleDos (see below)            */
  239.          byte  ModemFlag;      /* (See MODEM FLAG below)                    */
  240.          byte  edit_exit;      /* ERRORLEVEL to use if Matrix area changed  */
  241.          byte  LogFlag;        /* (See LOG FLAG below)                      */
  242.          byte  BYTE1;          /*                                           */
  243.          byte  BYTE2;          /*                                           */
  244.          byte  StyleFlag;      /* (See STYLE FLAG below)                    */
  245.          byte  task_num;       /* for multi-tasking systems                 */
  246.          byte  exit_val;       /* ERRORLEVEL to use after caller            */
  247.          byte  val_outside;    /* ERRORLEVEL for O)utside                   */
  248.          byte  val_zero;       /* ERRORLEVEL for sysop 0 command            */
  249.          byte  FWDflag;        /* Bits to control IN TRANSIT messages       */
  250.          byte  BYTE4;          /*                                           */
  251.          byte  crashexit;      /* non-zero= ErrorLevel exit                 */
  252.          byte  BYTE5;          /*                                           */
  253.          byte  BYTE6;          /*                                           */
  254.          byte  arc_exit;       /* ErrorLevel for after incomming ARCmail    */
  255.          byte  net_baud;       /* Min. baud for remote netmail systems      */
  256.          int   carrier_mask;
  257.          int   handshake_mask;
  258.          int   ctla_priv;      /* Priv to see CONTROL-A lines in messages   */
  259.          int   max_baud;       /* fastest speed we can use                  */
  260.          int   min_baud;       /* minimum baud to get on-line               */
  261.          int   color_baud;     /* min baud for graphics                     */
  262.          int   com_port;       /* Com1=0, Com2=1, FF=keyboard               */
  263.          int   logon_priv;     /* Access level for new users                */
  264.          int   date_style;     /* Used for FILES.BBS display                */
  265.          int   seenby_priv;    /* Min priv to see SEEN_BY line              */
  266.  
  267.          int   msg_ask[16];    /* Array of privs. for message attr ask's    */
  268.          int   msg_assume[16]; /* Array of privs. for message attr assume's */
  269.          int   msg_fromfile;   /* Priv. for doing message from file         */
  270.  
  271.          byte  BYTE8;          /*                                           */
  272.          byte  video;          /* 0=Dos, 1=Fossil 2=IBM                     */
  273.  
  274.          byte  filler[8];
  275.  
  276.          word  logon_time;     /* time to give for logons                   */
  277.  
  278.          byte  echo_exit;      /* ERRORLEVEL for after inbound echomail     */
  279.  
  280.          byte  Flags2;         /* See "FLAGS 2" below                       */
  281.          byte  Flags;          /* See "FLAGS" below                         */
  282.  
  283.          word  our_zone;
  284.          word  matrix_mask;
  285.          
  286.          struct class_rec class[MAXCLASS];
  287.          struct _ndi alias[ALIAS_CNT];
  288.  
  289.  
  290.                /*-----------------------------------------------------------*/
  291.                /* OFFSETS                                                   */
  292.                /*-----------------------------------------------------------*/
  293.          OFS   m_init;         /* modem initialization string               */
  294.          OFS   predial;        /* modem dial command sent before number     */
  295.          OFS   postdial;       /* modem command sent after dialed number    */
  296.          OFS   timeformat;
  297.          OFS   dateformat;
  298.          OFS   fkey_path;      /* path to `F-key files'                     */
  299.          OFS   parm_outside;   /* prog/parms for O)utside                   */
  300.          OFS   parm_zero;      /* parm for sysop 0 command                  */
  301.          OFS   sys_path;       /* path to SYSTEM?.BBS files                 */
  302.          OFS   user_file;      /* path/filename of User.Bbs                 */
  303.          OFS   net_info;       /* path to NODELIST files                    */
  304.          OFS   sched_name;     /* name of file with _sched array            */
  305.          OFS   logo;           /* first file shown to a caller              */
  306.          OFS   welcome;        /* shown after logon                         */
  307.          OFS   bulletin;       /* shown after the welcome file              */
  308.          OFS   editorial;
  309.          OFS   quote;
  310.          OFS   question;       /* Questionnaire available on the main menu  */
  311.          OFS   request_list;   /* list of files approved for file requests  */
  312.          OFS   newuser1;
  313.          OFS   newuser2;
  314.          OFS   rookie;
  315.          OFS   application;    /* new user questionnaire                    */
  316.          OFS   avail_list;     /* file to send when FILES is file requested */
  317.          OFS   hlp_editor;     /* Intro to msg editor for novices.          */
  318.          OFS   hlp_replace;    /* Explain the Msg.Editor E)dit command      */
  319.          OFS   msg_inquire;    /* Explain the Msg. I)nquire command         */
  320.          OFS   hlp_locate;     /* Explain the Files L)ocate command         */
  321.          OFS   hlp_contents;   /* Explain the Files C)ontents command       */
  322.          OFS   out_leaving;    /* Bon Voyage                                */
  323.          OFS   out_return;     /* Welcome back from O)utside                */
  324.          OFS   daylimit;       /* Sorry, you've been on too long...         */
  325.          OFS   timewarn;       /* warning about forced hangup               */
  326.          OFS   sysop;          /* sysop's name                              */
  327.          OFS   tooslow;        /* explains minimum logon baud rate          */
  328.          OFS   xferbaud;       /* explains minimum file transfer baud rate  */
  329.          OFS   msgarea_list;   /* dump file... used instead of Dir.Bbs      */
  330.          OFS   file_area_list; /* dump file... used instead of Dir.Bbs      */
  331.          OFS   maillist_file;  /* default "nodelist" file                   */
  332.          OFS   byebye;         /* file displayed at logoff                  */
  333.          OFS   protocols[MAX_EXTERN]; /* external file protocol programs    */
  334.          OFS   local_editor;
  335.          OFS   file_mgt;       /* external file section management          */
  336.          OFS   hold_area;      /* path to pending outbound matrix traffic   */
  337.          OFS   barricade;
  338.          OFS   oped_menu;
  339.          OFS   msg_mgt;        /* external message section maintenance      */
  340.  
  341.          OFS   mailpath;       /* path to inbound bundles                   */
  342.          OFS   filepath;       /* path for inbound matrix files             */
  343.          OFS   oped_help;      /* help file for the full-screen editor      */
  344.          OFS   temppath;       /* place to put temporary files              */
  345.          OFS   m_busy;         /* mdm cmd to take modem off hook            */
  346.          OFS   system_name;    /* board's name                              */
  347.          OFS   freq_about;     /* File Request: ABOUT file                  */
  348.  
  349.          OFS   OFS0;
  350.          OFS   OFS1;
  351.          OFS   OFS2;
  352.          OFS   OFS3;
  353.          OFS   OFS4;
  354.          OFS   OFS5;
  355.          OFS   OFS6;
  356.          OFS   OFS7;
  357.          OFS   syl;            /* default system language file              */
  358.          OFS   usl;            /* default user language file                */
  359.  
  360.                /*-----------------------------------------------------------*/
  361.                /* Log_Name must always be the last offset in this struct    */
  362.                /* because Bbs_Init uses that symbol to flag the end of      */
  363.                /* the offsets.                                              */
  364.                /*-----------------------------------------------------------*/
  365.          OFS   log_name;       /* name of the log file                      */
  366.  
  367.  
  368.                /*-----------------------------------------------------------*/
  369.                /* Big blob of stuff                                         */
  370.                /* It's a sequence of null-terminated character arrays...    */
  371.                /* pointed-to by the offsets (above).                        */
  372.                /*-----------------------------------------------------------*/
  373.          char  buf[CTLSIZE];
  374.    };
  375.  
  376.  
  377. /*--------------------------------------------------------------------------*/
  378. /* Multitaskers (possible values for `ctl.multitasker'                      */
  379. /*              NOTE: 0 means no multitasker in use                         */
  380. /*--------------------------------------------------------------------------*/
  381. #define DoubleDOS 1
  382. #define DesqView  2
  383. #define TopView   2
  384. #define TaskView  2
  385.  
  386.  
  387. /*--------------------------------------------------------------------------*/
  388. /* Matrix mask                                                              */
  389. /* Undefined bits are reserved by Opus                                      */
  390. /*--------------------------------------------------------------------------*/
  391. #define NO_TRAFFIC 0x0001  /* ok to send outbound local 0000 0000 0000 0001 */
  392. #define LOCAL_ONLY 0x0002  /* ok to send outbound local 0000 0000 0000 0010 */
  393. #define OPUS_ONLY  0x0004  /* only send to #CM systems  0000 0000 0000 0100 */
  394.  
  395. #define NO_EXITS   0x2000  /* crash/arc exits ignored   0010 0000 0000 0000 */
  396. #define MAIL_ONLY  0x4000  /* no human callers allowed  0100 0000 0000 0000 */
  397. #define TAKE_REQ   0x8000  /* file requests are ok      1000 0000 0000 0000 */
  398.  
  399.  
  400. /*--------------------------------------------------------------------------*/
  401. /* FLAGS                                                                    */
  402. /*--------------------------------------------------------------------------*/
  403. #define LOGECHO    0x01    /* log echomail areas                  0000 0001 */
  404. #define STEADY     0x02    /* never change baud rate              0000 0010 */
  405. #define ECHOSCAN   0x04    /* automatically scan echo's           0000 0100 */
  406. #define ECHO_GUARD 0x08    /* no toss un-pwd echo arc             0000 1000 */
  407. #define F_NOCRASH  0x40    /* Don't accept crash mail             0100 0000 */
  408. #define F_UNPK     0x80    /* Unpack incomming arcmail            1000 0000 */
  409.  
  410.  
  411. /*--------------------------------------------------------------------------*/
  412. /* FLAGS 2                                                                  */
  413. /*--------------------------------------------------------------------------*/
  414. #define NO_USRLIST 0x01    /* no user list (enter msg)            0000 0001 */
  415. #define WATCHDOG   0x02    /* Reboot during outside               0000 0010 */
  416. #define F2_TOSS    0x04    /* Toss incomming echomail             0000 0100 */
  417.                            /*                                     0000 1000 */
  418. #define F2_DOSFILE 0x10    /* Close stdAUX and stdPRN             0001 0000 */
  419. #define F2_PRIMARY 0x20    /* MultiTasker Primary task            0010 0000 */
  420. #define F2_SECOND  0x40    /* MultiTasker Secondary task          0100 0000 */
  421.  
  422.  
  423. /*--------------------------------------------------------------------------*/
  424. /* FWDflags (bits to control IN TRANSIT messages)                           */
  425. /*--------------------------------------------------------------------------*/
  426. #define FWD_NONE   0x01    /* No IN TRANSIT netmail               0000 0001 */
  427. #define FWD_PWD    0x02    /* IN TRANSIT by pwd only              0000 0010 */
  428. #define FWD_TONET  0x04    /* Accept IN TRANSIT only to my net    0000 0100 */
  429. #define FWD_NOBITS 0x08    /* No IN TRANSIT if extended bits used 0000 1000 */
  430.  
  431.  
  432. /*--------------------------------------------------------------------------*/
  433. /* LOG FLAGS                                                                */
  434. /*--------------------------------------------------------------------------*/
  435. #define LOG_TERSE  0x01    /* brief log                           0000 0001 */
  436. #define LOG_WORDY  0x02    /* wordy log                           0000 0010 */
  437. #define LOG_TRACE  0x04    /* very wordy log                      0000 0100 */
  438.  
  439.  
  440. /*--------------------------------------------------------------------------*/
  441. /* MODEM FLAGS                                                              */
  442. /*--------------------------------------------------------------------------*/
  443. #define M_SNOOP    0x01    /* sysop display on                    0000 0001 */
  444. #define M_DTR      0x02    /* drop DTR to look busy               0000 0010 */
  445. #define M_BRKCLEAR 0x04    /* Use BREAK to clear outbound buffer  0000 0100 */
  446.  
  447. /*--------------------------------------------------------------------------*/
  448. /* STYLE FLAGS                                                              */
  449. /*--------------------------------------------------------------------------*/
  450. #define SF_PATH    0x01    /* use path, not Dir.Bbs               0000 0001 */
  451. #define SF_KILL    0x02    /* Kill rec'd pvt messages             0000 0010 */
  452. #define SF_ASKKILL 0x04    /* ASK about killing msgs              0000 0100 */
  453.  
  454.  
  455. #define SET_FLAG(x,y)    ((x)|=(y))
  456. #define CLEAR_FLAG(x,y)  ((x)&=(~(y)))
  457. #define isFLAG(x,y)      ((x)&(y))
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.    
  467. /*--------------------------------------------------------------------------*/
  468. /* The rest of this file contains structure definitions similar to those    */
  469. /* used by Fido<tm> version 11w.  No claim is made that Opus will maintain  */
  470. /* compatibility with these structures beyond Opus version 0.               */
  471. /*                                                                          */
  472. /* The original version of the following items can be found in STRUCT.H, an */
  473. /* include file writte (and probably copyrighted by) Tom Jennings.          */
  474. /*--------------------------------------------------------------------------*/
  475.  
  476.  
  477.  
  478.  
  479.  
  480. /*--------------------------------------------------------------------------*/
  481. /* THE USER FILE                                                            */
  482. /* Please note that the user structure will be changed in the near future.  */
  483. /*--------------------------------------------------------------------------*/
  484.    
  485. #define  MAXLREAD  0x0a    /* Number of msg area pointers to maintain       */
  486.  
  487. struct   _usr
  488.    begin
  489.       char name[36];       /* Caller's first and last names                 */
  490.       char city[36];       /* Caller's location                             */
  491.  
  492.       struct {             /* Last message read for the prior 10 areas      */
  493.         word area;
  494.         word msg;
  495.       } lastmsg[MAXLREAD];
  496.  
  497.       char pwd[16];        /* Password                                      */
  498.       word times;          /* Number of previous calls to this system       */
  499.       int  help;           /* Help level (see below)                        */
  500.       word tabs;           /* 0=transmit <sp> instead of <tab>              */
  501.       word nulls;          /* Number of Nulls (delays) after <cr>           */
  502.       word msg;            /* Last message area visited                     */
  503.       bit  filler   : 2;
  504.       bit  no_ibmchr: 1;   /* Set: can't receive IBM "upper 128" characters */
  505.       bit  use_lore : 1;   /* Use the line-oriented editor */
  506.       bit  more     : 1;   /* Wants the "MORE?" prompt                      */
  507.       bit  ansi     : 1;   /* OPUS: set=wants Ansi                          */
  508.       bit  kludge   : 1;   /* OPUS: set=used Opus before                    */
  509.       bit  formfeed : 1;   /* OPUS: set=transmit <ff>, clear=ignore <ff>    */
  510.       int  priv;           /* Access level (see below)                      */
  511.       char ldate[20];      /* Date of previous date (AsciiZ string)         */
  512.       int  time;           /* Time on-line so-far today                     */
  513.       word flag;           /* Used to hold baud rate on O)utside command    */
  514.       int  upld;           /* K-bytes uploaded, all calls                   */
  515.       int  dnld;           /* K-bytes downloaded, all calls                 */
  516.       int  dnldl;          /* K-bytes downloaded, today                     */
  517.       word files;          /* Last file area visited                        */
  518.       byte width;          /* Width of the caller's monitor                 */
  519.       byte len;            /* Height of the caller's */
  520.       int  credit;
  521.       int  debit;
  522.    end;
  523.  
  524.  
  525.  
  526. /*--------------------------------------------------------------------------*/
  527. /* Access levels                                                            */
  528. /* For information on how these are used in Opus, read the TechRef pamphlet */
  529. /* called REF_PRIV.DOC and the sample control file called OPUS.CTL          */
  530. /*--------------------------------------------------------------------------*/
  531. #define  TWIT        0xFFFE
  532. #define  DISGRACE    0x0000
  533. #define  NORMAL      0x0002
  534. #define  PRIVEL      0x0004
  535. #define  EXTRA       0x0006
  536. #define  ASSTSYSOP   0x0008
  537. #define  SYSOP       0x000A
  538. #define  HIDDEN      0x000B
  539.  
  540.          /* Means no privilege level is set and/or applicable At LOGON,     */
  541.          /* for example, it means system is for PRE-REGISTERED users only.  */
  542. #define  NO_PRIV  30000
  543.  
  544.  
  545.  
  546.  
  547. /*--------------------------------------------------------------------------*/
  548. /* User help levels                                                         */
  549. /*--------------------------------------------------------------------------*/
  550. #define  USING_FTB   0x01  /* caller is using the Full-Tilt-Boogie method   */
  551. #define  EXPERT      0x02  /* grizzled veteran, no menus at all             */
  552. #define  REGULAR     0x04  /* experienced user, brief menus                 */
  553. #define  NOVICE      0x06  /* Full menus plus additional hand-holding       */
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564. /*--------------------------------------------------------------------------*/
  565. /*                                                                          */
  566. /* MESSAGE AND FILE AREAS                                                   */
  567. /*                                                                          */
  568. /*--------------------------------------------------------------------------*/
  569.  
  570.  
  571. /*--------------------------------------------------------------------------*/
  572. /* System?.Bbs structure                                                    */
  573. /* Please note that the `_sys' structure should NOT be considered stable.   */
  574. /*--------------------------------------------------------------------------*/
  575. struct _sys {              /* SQUIGGLES?  Humph!                            */
  576.     word ls_caller;        /* Used in SYSTEM.BBS only: number of callers    */
  577.     int  priv;             /* Minimum privs required to get to the area     */
  578.     byte msgpath[40];      /* Path to messages                              */
  579.     byte bbspath[40];      /* Path to BBS/GBS files *or* the barricade file */
  580.     byte hlppath[40];      /* Path to the user-help system                  */
  581.     byte uppath[40];       /* Path to the file upload sub-directory         */
  582.     byte filepath[40];     /* Path to the file download sub-directory       */
  583.     word attrib;           /* Area attribute (see below)                    */
  584.     word ms_caller;        /* Unused by Opus v0.0                           */
  585.     long quote_pos;        /* Position of next usable byte in Quote file    */
  586. };
  587.  
  588. /*--------------------------------------------------------------------------*/
  589. /* Area attributes (limit or describe the behavior of an area)              */
  590. /*--------------------------------------------------------------------------*/
  591. #define  SYSMAIL   0x01    /* is a mail area                                */
  592. #define  SYSOVR    0x02    /* overwriting files OK (unused by Opus)         */
  593. #define  NOPUBLIC  0x04    /* OPUS: Disallow public messages                */
  594. #define  NOPRIVATE 0x08    /* OPUS: Disallow private messages               */
  595. #define  ANON_OK   0x10    /* OPUS: Enable anonymous messages               */
  596. #define  ECHOMAIL  0x20    /* OPUS: Set=Echomail Clear=Not Echomail         */
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604. /*--------------------------------------------------------------------------*/
  605. /* THE MENU SYSTEM                                                          */
  606. /* A "priv" file is a sequence of these structures.  Note that the "priv"   */
  607. /* file system is fairly high on Wynn's DOOMED LIST.                        */
  608. /*--------------------------------------------------------------------------*/
  609.  
  610. struct _cmd
  611.    begin
  612.       char  name[20];
  613.       int   priv;
  614.    end;
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621. /*--------------------------------------------------------------------------*/
  622. /*                                                                          */
  623. /* MESSAGES                                                                 */
  624. /*                                                                          */
  625. /*--------------------------------------------------------------------------*/
  626.  
  627. /*--------------------------------------------------------------------------*/
  628. /* Message header                                                           */
  629. /*--------------------------------------------------------------------------*/
  630. struct _msg
  631.    begin
  632.       byte from[36];
  633.       byte to[36];
  634.       byte subj[72];
  635.       byte date[20];       /* Obsolete/unused ASCII date information        */
  636.       word times;          /* FIDO<tm>: Number of times read                */
  637.       word dest;           /* Destination node                              */
  638.       word orig;           /* Origination node number                       */
  639.       word cost;           /* Unit cost charged to send the message         */
  640.  
  641.       word orig_net;       /* Origination network number                    */
  642.       word dest_net;       /* Destination network number                    */
  643.                            
  644.                            /* A TIMESTAMP is a 32-bit integer in the Unix   */
  645.                            /* flavor (ie. the number of seconds since       */
  646.                            /* January 1, 1970).  Timestamps in messages are */
  647.                            /* always Greenwich Mean Time, never local time. */
  648.  
  649.       struct _stamp date_written;   /* When user wrote the msg              */
  650.       struct _stamp date_arrived;   /* When msg arrived on-line             */
  651.  
  652.       word reply;          /* Current msg is a reply to this msg number     */
  653.       word attr;           /* Attribute (behavior) of the message           */
  654.       word up;             /* Next message in the thread                    */
  655.    end;
  656.  
  657.  
  658.  
  659. /*--------------------------------------------------------------------------*/
  660. /* Message attributes                                                       */
  661. /*--------------------------------------------------------------------------*/
  662. #define MSGPRIVATE 0x0001  /* private message         * 0000 0000 0000 0001 */
  663. #define MSGCRASH   0x0002  /* squirtmail              * 0000 0000 0000 0010 */
  664. #define MSGREAD    0x0004  /* read by addressee       * 0000 0000 0000 0100 */
  665. #define MSGSENT    0x0008  /* sent OK (remote)          0000 0000 0000 1000 */
  666. #define MSGFILE    0x0010  /* file attached to msg    * 0000 0000 0001 0000 */
  667. #define MSGFWD     0x0020  /* in transit                0000 0000 0010 0000 */
  668. #define MSGORPHAN  0x0040  /* unknown dest node         0000 0000 0100 0000 */
  669. #define MSGKILL    0x0080  /* kill after bundling     * 0000 0000 1000 0000 */
  670. #define MSGLOCAL   0x0100  /* FidoNet vs. local         0000 0001 0000 0000 */
  671. #define MSGHOLD    0x0200  /* Hold, don't send        * 0000 0010 0000 0000 */
  672. #define MSGXX2     0x0400  /* <reserved>             X? 0000 0100 0000 0000 */
  673. #define MSGFRQ     0x0800  /* file request            * 0000 1000 0000 0000 */
  674. #define MSGRRQ     0x1000  /* receipt requested      X* 0001 0000 0000 0000 */
  675. #define MSGCPT     0x2000  /* is a return receipt    X* 0010 0000 0000 0000 */
  676. #define MSGARQ     0x4000  /* audit trail requested  X* 0100 0000 0000 0000 */
  677. #define MSGURQ     0x8000  /* update request         X* 1000 0000 0000 0000 */
  678.                                                    /*-----------------------*/
  679.                                                    /* ^                     */
  680.                                                    /* |                     */
  681.                                                    /*  * = preserved by     */
  682.                                                    /*      the network      */
  683.                                                    /*  ? = stripped by the  */
  684.                                                    /*      net (FTSC spec)  */
  685.                                                    /*      but preserved    */
  686.                                                    /*      by seadog<tm>    */
  687.                                                    /*  X = not used by Opus */
  688.                                                    /*-----------------------*/
  689.  
  690.  
  691.  
  692.  
  693. /*--------------------------------------------------------------------------*/
  694. /*                                                                          */
  695. /* EVENTS                                                                   */
  696. /*                                                                          */
  697. /*--------------------------------------------------------------------------*/
  698. #define EXT_EVENT   'X'    /* External event (return to Dos)                */
  699. #define YELL_EVENT  'Y'    /* Yell event (when Yell is on)                  */
  700. #define SCHEDS      35     /* Maximum number of events                      */
  701.  
  702. struct _time
  703.    begin
  704.       word  year;          /* Usable but doesn't make much sense            */
  705.       word  month;         /* For events only in 1 month                    */
  706.       word  day;           /* Day of the month                              */
  707.       word  daywk;         /* Day of the week (0=Sun,6=Sat,7=ALL)           */
  708.       word  hour;          /* 0..23                                         */
  709.       word  mins;          /* 0..59                                         */
  710.       word  sec;           /* Unused                                        */
  711.    end;
  712.  
  713.  
  714. /*--------------------------------------------------------------------------*/
  715. /* Schedule file record                                                     */
  716. /*--------------------------------------------------------------------------*/
  717. struct _sched
  718.    begin
  719.       struct _time time;   /* Starting time of the event                    */
  720.       word  len;           /* Duration of event in minutes                  */
  721.       int   enable;        /* 1==Enabled                                    */
  722.       word  trigger;       /* Unknown/unused                                */
  723.       word  result;        /* X errorlevel; OPUS: Yell bell duration        */
  724.       byte  tag;           /* Event type ('A'..'Z')                         */
  725.       byte  junk_1;        /* OPUS: ADDED TO MAKE THIS WORD-ALIGNED         */
  726.       word  last_ran;      /* OPUS: Day of the month executed last          */
  727.       word  b;             /* OPUS: Reserved for Opus                       */   
  728.       word  c;             /* OPUS: Reserved for external utilities         */
  729.       word  behavior;      /* (See below)                                   */
  730.       byte  event_mask;    /* OPUS: Force this event                        */
  731.       byte  GMT;           /* OPUS: Set=GMT, Clear=local time               */
  732.    end;
  733.  
  734.  
  735. /* MASKS */
  736. #define  FORCE_EVENT 0x0001 /* Execute this always */
  737.  
  738.  
  739. /* Z EVENTS BEHAVIOR...                                                     */
  740. /*    If RESULT==1, the `behavior' field contains a "matrix mask".  Those   */
  741. /*                  are described in #define's near the CTL declaration.    */
  742. /*    If RESULT==2, it is an internal housekeeping event                    */
  743.  
  744.  
  745. /* HOUSEKEEPING  */
  746. #define CLEAN_HOLD 0x0001  /* del HoldArea "$" files    0000 0000 0000 0001 */
  747. #define SCAN_ALL   0x0002  /* scan all echomail areas   0000 0000 0000 0010 */
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756. /*--------------------------------------------------------------------------*/
  757. /* Message bundle header                                                    */
  758. /*--------------------------------------------------------------------------*/
  759.  
  760. #define PKTVER       2        /* Used for `ver' (below)                     */
  761.  
  762.                               /*--------------------------------------------*/
  763.                               /* POSSIBLE VALUES FOR `product' (below)      */
  764.                               /*                                            */
  765.                               /* NOTE: These product codes are assigned by  */
  766.                               /* the FidoNet<tm> Technical Stardards Com-   */
  767.                               /* mittee.  If you are writing a program that */
  768.                               /* builds bundles, you will need a product    */
  769.                               /* code.  Please use ZERO until you get your  */
  770.                               /* own.  For more information on codes, write */
  771.                               /* to FTSC at 220/1.                          */
  772.                               /*                                            */
  773.                               /*--------------------------------------------*/
  774. #define isFIDO       0        /* Fido<tm>'s product code                    */
  775. #define isSPARK      1        /* FastScan, Rover, etc                       */
  776. #define isSEA        2        /* Seadog<tm>'s product code                  */
  777. #define isOPUS       5        /* Opus<no_tm>'s product code (a PRIME number)*/
  778. #define isHENK       6        /* Dutchie product code                       */
  779. #define isBRINKERS   7
  780. #define isTABBIE     8
  781. #define isDOUG       9
  782.  
  783.  
  784. struct _pkthdr
  785.    begin
  786.       int   orig_node;        /* originating node               */
  787.       int   dest_node;        /* destination node               */
  788.       int   year;             /* 0..99  when packet was created */
  789.       int   month;            /* 1..12  when packet was created */
  790.       int   day;              /* 1..31  when packet was created */
  791.       int   hour;             /* 0..23  when packet was created */
  792.       int   minute;           /* 0..59  when packet was created */
  793.       int   second;           /* 0..59  when packet was created */
  794.       int   rate;             /* destination's baud rate        */
  795.       int   ver;              /* packet version                 */
  796.       int   orig_net;         /* originating network number     */
  797.       int   dest_net;         /* destination network number     */
  798.       char  product;          /* product type                   */
  799.       char  x1;               /* filler (used by some systems)  */
  800.  
  801.                               /* ------------------------------ */
  802.                               /* THE FOLLOWING SECTION IS NOT   */
  803.                               /* THE SAME ACROSS SYSTEM LINES:  */
  804.                               /* ------------------------------ */
  805.       byte pwd_kludge[6];
  806.       byte B_fill1[2];
  807.       byte B_fill2[20];       
  808.       long B_fill3;
  809.    end;
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819. /*--------------------------------------------------------------------------*/
  820. /* WAZOO                                                                    */
  821. /*--------------------------------------------------------------------------*/
  822.  
  823. #ifdef WAZOO_SECTION
  824.  
  825. #ifndef ACK
  826. #define ACK    0x06
  827. #endif
  828.  
  829. #ifndef NAK
  830. #define NAK    0x15
  831. #endif
  832.  
  833. #ifndef ENQ
  834. #define ENQ    0x05
  835. #endif
  836.  
  837. #ifndef YOOHOO
  838. #define YOOHOO 0x00f1     /* 241 (a prime number, I think) */
  839. #endif
  840.  
  841. #ifndef  TSYNC    
  842. #define  TSYNC 0x00ae
  843. #endif
  844.  
  845. struct   _Hello
  846.    begin
  847.       word     signal;           /* always 'o'     (0x6f)                   */
  848.       word     hello_version;    /* currently 1    (0x01)                   */
  849.       word     product;          /* product code                            */
  850.       word     product_maj;      /* major revision of the product           */
  851.       word     product_min;      /* minor revision of the product           */
  852.       char     my_name[60];      /* Other end's name                        */
  853.       char     sysop[20];        /* sysop's name                            */
  854.       word     my_zone;          /* 0== not supported                       */
  855.       word     my_net;           /* out primary net number                  */
  856.       word     my_node;          /* our primary node number                 */
  857.       word     my_point;         /* 0== not supported                       */
  858.       byte     my_password[8];   /* ONLY 6 CHARACTERS ARE SIGNIFICANT !!!!! */
  859.       byte     reserved2[8];     /* reserved by Opus                        */
  860.       word     capabilities;     /* see below                               */
  861.       byte     reserved3[12];    /* available to non-Opus systems by prior  */
  862.                                  /* "approval" of 124/108.                  */
  863.    end; /* size 128 bytes */
  864.  
  865.  
  866. /*--------------------------------------------------------------------------*/
  867. /* YOOHOO<tm> CAPABILITY VALUES                                             */
  868. /*--------------------------------------------------------------------------*/
  869. #define Y_DIETIFNA 0x0001  /* Can do LoTek            0000 0000 0000 0001 */
  870. #define FTB_USER   0x0002  /* reserved by Opus        0000 0000 0000 0010 */
  871. #define Bit_2      0x0004  /* reserved by Opus        0000 0000 0000 0100 */
  872. #define ZED_ZAPPER 0x0008  /* Can do ZModem/plain     0000 0000 0000 1000 */
  873. #define Bit_4      0x0010  /* reserved by Opus        0000 0000 0001 0000 */
  874. #define Bit_5      0x0020  /* reserved by Opus        0000 0000 0010 0000 */
  875. #define Bit_6      0x0040  /* reserved by Opus        0000 0000 0100 0000 */
  876. #define Bit_7      0x0080  /* reserved by Opus        0000 0000 1000 0000 */
  877. #define Bit_8      0x0100  /* reserved by Opus        0000 0001 0000 0000 */
  878. #define Bit_9      0x0200  /* reserved by Opus        0000 0010 0000 0000 */
  879. #define Bit_a      0x0400  /* reserved by Opus        0000 0100 0000 0000 */
  880. #define Bit_b      0x0800  /* reserved by Opus        0000 1000 0000 0000 */
  881. #define Bit_c      0x1000  /* reserved by Opus        0001 0000 0000 0000 */
  882. #define Bit_d      0x2000  /* reserved by Opus        0010 0000 0000 0000 */
  883. #define Bit_e      0x4000  /* reserved by Opus        0100 0000 0000 0000 */
  884. #define WZ_FREQ    0x8000  /* accepts file requests   1000 0000 0000 0000 */
  885.  
  886. #endif /* WaZOO_Section */
  887.  
  888. /* END OF FILE: opus.h */
  889.  
  890.  
  891.